//
//  ZResourceManager.m
//  WeClubs
//
//  Created by Zed Link on 11/5/2017.
//  Copyright © 2017 Zed. All rights reserved.
//

#import "ZResourceManager.h"


@interface ZResourceManager ()

/** 组织创建相关信息 */
@property (strong, nonatomic) NSDictionary *clubCreateMessage;

@end

@implementation ZResourceManager

Z_SINGLETON_IMPLEMENTATION(ZResourceManager)



#pragma mark - 创建组织相关

- (NSDictionary *)clubCreateMessage
{
    if (_clubCreateMessage == nil) {
        _clubCreateMessage = [NSDictionary dictionaryWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"ZClubCreateMessage.plist" withExtension:nil]];
    }
    return _clubCreateMessage;
}

- (NSArray *)clubType
{
    return [self.clubCreateMessage objectForKey:@"Club_Type"];
}

- (NSMutableArray<NSMutableDictionary *> *)clubDepartment
{
    NSArray *archArray = [self.clubCreateMessage objectForKey:@"Club_Architecture"];
    
    NSMutableArray *tempArrM = [NSMutableArray arrayWithCapacity:archArray.count];
    for (NSDictionary *dict in archArray) {
        [tempArrM addObject:[dict mutableCopy]];
    }
    return [tempArrM copy];
}

- (NSMutableArray<NSDictionary *> *)clubPosition
{
    NSArray *positionArray = [self.clubCreateMessage objectForKey:@"Club_Position"];
    
    NSMutableArray *tempArrM = [NSMutableArray arrayWithCapacity:positionArray.count];
    for (NSDictionary *dict in positionArray) {
        [tempArrM addObject:[dict mutableCopy]];
    }
    return [tempArrM mutableCopy];
}

@end
